var api = require('../../util/api.js');

Page({
    data: {

    },
    goLogin: function () {
        this.data.hasLogin || wx.navigateTo({
            url: "/pages/auth/login/login"
        });
    },
    goContestManagement: function () {
        wx.navigateTo({
            url: "/pages/lhjd/examine/manage"
        });
    },
    goJbfs: function () {
        wx.navigateTo({
            url: "/pages/jbfs/jbfs"
        });
    },
    //我的成绩
    toMyOrganization: function () {
        wx.navigateTo({
            url: "/pages/lhjd/examine/score"
        });
    },
    //试油监督 数据分析
    showSYJD: function () {
        wx.navigateTo({
            url: "/pages/lhjd/examine/analyze"
        });
    },
    //录井监督 数据分析
    showLJJD: function () {
        wx.navigateTo({
            url: "/pages/ljjd/examine/analyze"
        });
    },
    //钻井监督 数据分析
    showZJJD: function () {
        wx.navigateTo({
            url: "/pages/zjjd/examine/analyze"
        });
    },
    //测井监督 数据分析
    showCJJD: function () {
        wx.navigateTo({
            url: "/pages/cjjd/examine/analyze"
        });
    },
    showRoles: function () {
        wx.navigateTo({
            url: "../role/role"
        });
    },
    onShow: function () {

    },
    onLoad: function () {
        let _this = this;
        api.get(api.url.wechatUserList, {
            userId: api.getSysUser().userId,
            appid: api.appid
        }).then(res => {
            _this.setData({
                userInfo: res.rows[0],
                wx01: api.hasPerm('lhjd:wx:01'),
                wx03: api.hasPerm('lhjd:wx:03'),
                wx04: api.hasPerm('lhjd:wx:04')
            });
        });
    },
    showPower: function () {
        wx.navigateTo({
            url: "../power/power"
        });
    },
    //我的举报
    goMyJb(e) {
        wx.navigateTo({
            url: "/pages/jbfs/list"
        });
    }
});